Ext.define('DCApp.view.relic.List', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.reliclist',
    
    requires: [
        'DCApp.controller.ListController',
        'DCApp.view.relic.ListModel'
    ],

    controller: 'list',
    plugins: ['gfilters'],
    viewModel: {
        type: 'reliclist'
    },
    bind: {
        store: '{objs}'
    },
    header:false,
    title: 'Array Grid',

    selType: 'checkboxmodel',
    
    tbar: ['->',{
        text: '录入',
        handler: 'onNew'
    }],
	
	listeners: {
        itemdblclick: 'onDblClick'
    },
    
    columns: [
		{
            text     : '文物ID',
            dataIndex: 'objId',
            filter: 'number'
        },
        {
            text     : '作者(窑口)',
            dataIndex: 'objAuthor',
            filter: 'string'
        },
        {
            text     : '分类',
            dataIndex: 'classa',
            filter: 'string',
            filter: {
                type: 'list',
                idField:'abbr',
                labelField:'name',
                store:DCApp.Cfg.getDistinctStore('com.cl.entity.Relic','classa')
            }
        },
        {
            text     : '文物编号',
            dataIndex: 'objNo',
            filter: 'string'
        },
        {
            text     : '文物名称',
            dataIndex: 'objName',
            filter: 'string'
        },
        {
            text     : '级别',
            dataIndex: 'grade',
            filter: 'string'
        },
        {
            text     : '正文字数',
            dataIndex: 'objNumber',
            filter: 'number'
        },
        {
            text     : '撰稿人',
            dataIndex: 'author',
            filter: 'string'
        }
    ],
    
    initComponent: function(){    	
    	 this.callParent();
    },
    onDestroy: function () {
        // do some cleanup
    	var me=this;
    	if(me.sel_win){
    		//this.sel_win.destroy();
    		Ext.destroy(me.sel_win);
    		me.sel_win=null;
    	}
    	me.callParent();
    }
 });
